SET PROC TO SOSPRO
set proc to boxproc
DO START
JOUR=SUBSTR(DTOC(DATE()),1,2)
MOIS=Cmonth(DATE())
save all like mois to n:mois
store 0 to SIGG,PRODEL,DDDEL,TOTL,NPROC,NDRUG,NDISP,FLAG
LIMCOM=24
DOI=date()
COMP='Y'
set colo to gr+/b
clea
DR1='N:'
DR2='Q:'
DO WHILE .T.
   set cursor off
   @  8, 0 say '             PERHATIAN !!               '
   @  8,40 SAY '             ATTENTION !!               '
   @ 10, 0 say '   Mohon Komputer ini jangan dimatikan  '
   @ 10,40 SAY '  Please do not turn this computer OFF  '
   @ 12, 0 say '               A T A U                  '
   @ 12,40 say '                 O R                    '
   @ 14, 0 SAY '        diutak-atik keyboardnya         '
   @ 14,40 say '         type on the keyboard           '
   @ 16, 0 say '      SEDANG MELAKUKAN PROSSESING       '
   @ 16,40 say '      CURRENTLY WAITING TO PROCESS      '
   @ 17, 0 SAY '        DATA HINGGA ESOK HARI !         '
   @ 17,40 SAY "       DATA FOR TOMORROW'S WORK !       "
   IF TIME()<'22:00'
      LSTKEY=INKEY()
      set colo to GR+/B,R+/N
      if LSTKEY<>0
         @ 21,14 say "ABANDON THIS PROGRAM !  PLEASE CONFIRM :       /"
         @ 21,55 PROMPT " YES "
         @ 21,63 PROMPT " NO "
         MENU TO PILH
         DO CASE
            CASE PILH=1
               CLEA
               return
            CASE PILH=2
               set colo to gr+/B
               @ 21,0 clea to 21,79
               LSTKEY=0
               LOOP
         ENDCASE
      else
         loop
      endif
   else
      IF time()<'23:50'
         set colo to bg+/b
         clea
         @ 21,12 say "DATE :"
         @ 21,20 say date()
         @ 21,52 say "TIME :"
         @ 21,60 say time()
         loop
      else
         FLAG=FLAG+1
         set cursor on
         SET COLO TO BG+/B
         CLEA
         SET CURSOR OFF
         @ 12,10 SAY '>>>>>> End of Day Procedure, DO NOT INTERRUPT !!!! <<<<<<'
         @ 14,10 SAY '>>>>>>>>>>>>>>>> END OF DAY PROCEDURES <<<<<<<<<<<<<<<<<<'
         @ 16,10 say '>>>>>>>>>>>>>> COPY DATABASES & MEMORIES <<<<<<<<<<<<<<<<'
         SET COLO TO GR+*/R+
         @ 23,75 SAY ".1."
         SET COLO TO BG+/B
         clea
         @ 12,10 SAY '>>>>>> End of Day Procedure, DO NOT INTERRUPT !!!! <<<<<<'
         @ 14,10 SAY '>>>>>>>>>>>>>>>> END OF DAY PROCEDURES <<<<<<<<<<<<<<<<<<'
         @ 16,10 say '>>>>>>>>>>>>>>>>>>>> PROCESS DATAS <<<<<<<<<<<<<<<<<<<<<<'
         @ 23,75 CLEA TO 23,77
         SET COLO TO GR+*/R+
         @ 23,75 SAY ".2."
         SET COLO TO BG+/B
?'PROC 0'
         do eodcopy2
?'PROC 1'
         DO EODP1
?'PROC 2'
         DO EODP2
?'PROC 3'
         DO EODP3
?'PROC 4'
         DO EODP4
?'PROC 5'
         DO EODP5
?'PROC 6'
         DO EODP6
?'PROC 7'
         SET COLO TO BG+/B
         CLEA
         @ 12,10 SAY '>>>>>> End of Day Procedure, DO NOT INTERRUPT !!!! <<<<<<'
         @ 14,10 SAY '>>>>>>>>>>>>>>>> END OF DAY PROCEDURES <<<<<<<<<<<<<<<<<<'
         @ 16,10 SAY '>>>>>>>>>>>>>>>>   RE-INDEXING FILES   <<<<<<<<<<<<<<<<<<'
         @ 23,75 CLEA TO 23,77
         SET COLO TO GR+*/R+
         @ 23,75 SAY ".3."
         SET COLO TO BG+/B
         DO INDEA
         DO INDEB
         SET COLO TO BG+/B,W+/N
         clea
         @ 12,10 SAY '>>>>>> End of Day Procedure, DO NOT INTERRUPT !!!! <<<<<<'
         @ 14,10 SAY '>>>>>>>>>>>>>>>> END OF DAY PROCEDURES <<<<<<<<<<<<<<<<<<'
         @ 16,10 say '>>>>>>>>>>>>>> COPY DATABASES & MEMORIES <<<<<<<<<<<<<<<<'
         @ 23,75 CLEA TO 23,77
         SET COLO TO GR+*/R+
         @ 23,75 SAY ".4."
         SET COLO TO BG+/B
         do eodcopy4
         DO EODP8
         clea
         rest from n:mois addi
         MOIS1=CMONTH(DATE())
         IF MOIS1<>MOIS .AND. SIGG=0
            @ 12,10 SAY '>>>>>> End of month Procedure DO NOT INTERRUPT !!! <<<<<<'
            @ 14,10 SAY '>>>>>>>>>>>>>>> END OF MONTH PROCEDURES <<<<<<<<<<<<<<<<<'
            @ 16,10 say '>>>>>>>>>>>>>> COPY DATABASES & MEMORIES <<<<<<<<<<<<<<<<'
            SET COLO TO GR+*/R+
            @ 23,75 SAY ".5."
            SET COLO TO BG+/B
            SIGG=1
            MOIS=MOIS1
            DO EOMBACK
            DO EOMP
            DO INDEACTM
         ENDIF
         lim=1
         DO INDEACT
         CLEA
         DO BOXT WITH 12,3,'PROCESSING COMPLETED, PRESS ANY KEY TO CONTINUE','GR+','RB',.F.,.T.
         SET COLO TO BG+/B,W+/N
         SET CURSOR ON
         clos all
      endif
   endif
ENDDO
